package com.bluezone.dec.system.controller;

import com.bluezone.dec.common.JsonResult;
import com.bluezone.dec.configuration.AppConfig;
import com.bluezone.dec.system.service.ExhaustGasAndWaterStatisticsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description 企业环保情况统计controller
 * @Author chenzhaoming
 * @CreateDate 2018/10/23 9:37
 * @Company 浙江航天恒嘉数据科技有限公司
 */
@Api(tags = "企业环保情况统计")
@RequestMapping("/dec/environmental")
@RestController
public class ExhaustGasAndWaterStatisticsController {

    @Autowired
    private ExhaustGasAndWaterStatisticsService gasAndWaterStatisticsService;

    @Autowired
    private AppConfig appConfig;

    @ApiOperation("标题卡片数据")
    @GetMapping("/title")
    public JsonResult statisticsCount() {

        return new JsonResult().ok(gasAndWaterStatisticsService.statisticsCount());
    }

    @ApiOperation("企业废水指标报警情况")
    @GetMapping("/water")
    public JsonResult waterGenerate() {

        return new JsonResult().ok(gasAndWaterStatisticsService.gasAndWaterGenerate( appConfig.getWaterCode()));
    }

    @ApiOperation("企业废气指标报警情况")
    @GetMapping("/gas")
    public JsonResult gasTreat() {

        return new JsonResult().ok(gasAndWaterStatisticsService.gasAndWaterGenerate(appConfig.getGasCode()));

    }

    @ApiOperation("企业投诉及投入情况")
    @GetMapping("/supervise-investment")
    public JsonResult superviseInvestment() {
        return new JsonResult().ok(gasAndWaterStatisticsService.superviseInvestment());

    }
}
